package com.at.abc.r421_e;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class b {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        String[] in = br.readLine().split(" ");
        int x = Integer.parseInt(in[0]);
        int y = Integer.parseInt(in[1]);
        long[] a = new long[10];
        a[0] = x;
        a[1] = y;
        for (int i = 2; i < 10; i++) {
            a[i] = f(a[i - 1], a[i - 2]);
        }
        out.println(a[9]);
        out.flush();
        out.close();
        br.close();
    }

    static long f(long a, long b) {
        long c = a + b;
        StringBuilder s = new StringBuilder(String.valueOf(c));
        s = s.reverse();
        return Long.parseLong(s.toString());
    }
}
